package com.ruoyi.interfaced.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.interfaced.mapper.ShopOrderInfoInterMapper;
import com.ruoyi.interfaced.domain.ShopOrderInfoInter;
import com.ruoyi.interfaced.service.IShopOrderInfoInterService;

/**
 * 订单Service业务层处理
 * 
 * @author ruoyi
 * @date 2021-12-03
 */
@Service
public class ShopOrderInfoInterServiceImpl implements IShopOrderInfoInterService
{
    @Autowired
    private ShopOrderInfoInterMapper shopOrderInfoMapper;


    /**
     * 添加订单
     */
    @Override
    public int insert(ShopOrderInfoInter shopOrderInfo)
    {
        return shopOrderInfoMapper.insert(shopOrderInfo);
    }
    /**
     * 查询订单
     * 
     * @param orderNo 订单主键
     * @return 订单
     */
    @Override
    public ShopOrderInfoInter selectShopOrderInfoByOrderNo(String orderNo)
    {
        return shopOrderInfoMapper.selectShopOrderInfoByOrderNo(orderNo);
    }

    /**
     * 查询订单列表
     * 
     * @param shopOrderInfo 订单
     * @return 订单
     */
    @Override
    public List<ShopOrderInfoInter> selectShopOrderInfoList(ShopOrderInfoInter shopOrderInfo)
    {
        return shopOrderInfoMapper.selectShopOrderInfoList(shopOrderInfo);
    }

    /**
     * 新增订单
     * 
     * @param shopOrderInfo 订单
     * @return 结果
     */
    @Override
    public int insertShopOrderInfo(ShopOrderInfoInter shopOrderInfo)
    {
        shopOrderInfo.setCreateTime(DateUtils.getNowDate());
        return shopOrderInfoMapper.insertShopOrderInfo(shopOrderInfo);
    }

    /**
     * 修改订单
     * 
     * @param shopOrderInfo 订单
     * @return 结果
     */
    @Override
    public int updateShopOrderInfo(ShopOrderInfoInter shopOrderInfo)
    {
        return shopOrderInfoMapper.updateShopOrderInfo(shopOrderInfo);
    }

    /**
     * 批量删除订单
     * 
     * @param orderNos 需要删除的订单主键
     * @return 结果
     */
    @Override
    public int deleteShopOrderInfoByOrderNos(String[] orderNos)
    {
        return shopOrderInfoMapper.deleteShopOrderInfoByOrderNos(orderNos);
    }

    /**
     * 删除订单信息
     * 
     * @param orderNo 订单主键
     * @return 结果
     */
    @Override
    public int deleteShopOrderInfoByOrderNo(String orderNo)
    {
        return shopOrderInfoMapper.deleteShopOrderInfoByOrderNo(orderNo);
    }
}
